﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IAOI.Platform.Test.Console
{
    public static class MessageListener
    {


         static MessageListener()
        {

        }

         public static string g;
    }

    class Program
    {
        static void Main(string[] args)
        {
      //      System.Configuration.ConfigurationManager.RefreshSection
      //      IAOI.Platform.Common.Configuration.ConfigurationManager.Settings
          var v =   MessageListener.g;


            int title = BlogSettings.Settings.FrontPagePostCount;
            System.Console.WriteLine(title);
        }
    }


    public class BlogSettings : ConfigurationSection
    {
        private static BlogSettings settings
          = ConfigurationManager.GetSection("BlogSettings") as BlogSettings;

        public static BlogSettings Settings
        {
            get
            {
                return settings;
            }
        }

        [ConfigurationProperty("frontPagePostCount"
          , DefaultValue = 20
          , IsRequired = false)]
        [IntegerValidator(MinValue = 1
          , MaxValue = 100)]
        public int FrontPagePostCount
        {
            get { return (int)this["frontPagePostCount"]; }
            set { this["frontPagePostCount"] = value; }
        }

 
    }

}
